{% extends "base.html" %}
{% block content %}
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <h1> 发送单个短信用户</h1>
    {{ result }}
    <hr>
    <form action="/message" method="POST">
        <label>手机号：</label>
        <input type='number' name='phone' />
        <label>短信内容：</label>
        <input name='content' />
        <input  class="btn btn-primary" type='submit' value='发送短信' />
    </form>
    <hr>
    {% if result %}
        <table class="table table-hover">
            <tr >
                <td>手机号 </td>
                <td>状态码 </td>
                <td>信息 </td>
            <tr>
            {% if result['code'] == 0 %}
            <tr class='success'>
                <td>{{ result['phone'] }} </td>
                <td>{{ result['code'] }} </td>
                <td>{{ result['message'] }} </td>
            <tr>
            {% else %}
            <tr class='danger'>
                <td>{{ result['phone'] }} </td>
                <td>{{ result['code'] }} </td>
                <td>{{ result['message'] }} </td>
            <tr>
            {% endif %}
        </table>
    {% endif %}
</div>
{% endblock %}